package 代理模式;

import java.lang.annotation.Annotation;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @author zzs
 * @ClassName StudentProxy.java
 * @Description
 * @createTime 2022年05月19日 20:06:00
 */
public class StudentProxy implements InvocationHandler {
    public OneStudent student;

    public StudentProxy(OneStudent student) {
        this.student = student;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("动态代理实现了");
        return method.invoke(student, args);
    }
}
